using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_TopLeftBack : UIBaseNode
    {

        #region Template Generate,don't modify
        protected partial class UIB_UIN_TopLeftBack
        {
            #region ObjectBinding Generate
            public IQIGame.Onigao.Framework.ExButtonBack btn_Back { protected set; get; }
            public IQIGame.Onigao.Framework.ExButton btn_Info { protected set; get; }
            public virtual void InitBinding(ObjectBinding __binding)
            {
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExButtonBack>("btn_Back", out var __tbv0);
                this.btn_Back = __tbv0;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExButton>("btn_Info", out var __tbv1);
                this.btn_Info = __tbv1;
            }
            #endregion ObjectBinding Generate 
        }
        #endregion Template Generate,don't modify

        #region fields & properties
        protected UIB_UIN_TopLeftBack ui { get; set; }
        public ExButton btnBack => this.ui.btn_Back;
        #endregion

        protected override void BeforeInit()
        {
            ui = new UIB_UIN_TopLeftBack();
            ui.InitBinding(this.csObjBind);
        }

        protected override void OnInit()
        {
            this.ui.btn_Back.onClick.AddListener(this.OnClickBack);
            this.ui.btn_Info.onClick.AddListener(this.OnClickInfo);
        }

        protected override void OnShow()
        {

        }

        protected override void OnHide()
        {

        }

        protected override void OnDispose()
        {

        }

        void OnClickBack()
        {
            this.belongWindow.Close();
        }

        void OnClickInfo()
        {
            // 单击左上的Info详情按钮 // this.belongWindow.GetType().FullName
        }
    }
}
